Make assertion more informative
authorAleksey Kladov <aleksey.kladov@gmail.com>
Tue, 3 Apr 2018 08:17:21 +0000 (11:17 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Tue, 3 Apr 2018 08:19:01 +0000 (11:19 +0300)
This assertion triggers when I try to build Cargo simultaneosly on
linux host and windows VM via a shared folder, but it's not clear
what is going on.

src/cargo/core/manifest.rs
src/cargo/util/toml/mod.rs

index 75e1e38e86fd63009709666be7f97bb9187a815d..6784cee7f13b12562204983e9a225130b3a14d74 100644 (file)
@@ -445,7 +445,11 @@ impl VirtualManifest {
 
 impl Target {
     fn with_path(src_path: PathBuf) -> Target {
-        assert!(src_path.is_absolute());
+        assert!(
+            src_path.is_absolute(),
+            "`{}` is not absolute",
+            src_path.display()
+        );
         Target {
             kind: TargetKind::Bin,
             name: String::new(),
index 3aa4f58755086f34a578c0350e6b65b7e035c91e..651928efdb430ce9463cd10d7bbf168e07684245 100644 (file)
@@ -14,7 +14,7 @@ use url::Url;
 
 use core::{GitReference, PackageIdSpec, Profiles, SourceId, WorkspaceConfig, WorkspaceRootConfig};
 use core::{Dependency, Manifest, PackageId, Summary, Target};
-use core::{EitherManifest, Edition, Feature, Features, VirtualManifest};
+use core::{Edition, EitherManifest, Feature, Features, VirtualManifest};
 use core::dependency::{Kind, Platform};
 use core::manifest::{LibKind, Lto, ManifestMetadata, Profile};
 use sources::CRATES_IO;